﻿using Roslyn.Compilers.CSharp;

namespace InterfaceWeaver.CustomTool
{
    public static class AttributeArgumentSyntaxExtensions
    {
        /// <summary>
        /// Gets the name of the argument.
        /// </summary>
        /// <param name="argument">The argument.</param>
        /// <returns></returns>
        public static string GetName(this AttributeArgumentSyntax argument)
        {
            return argument.NameEquals == null ? null : argument.NameEquals.Name.Identifier.ValueText;
        }
    }
}
